Merged
Conversation
Collaborator
|
This PR is exporting some structs that are private in order to call tls.Unmarshall, which I'm goin to delete in the next PR because |
d832cbf to
15b2c33
Compare
phbnf
reviewed
Apr 14, 2025
15b2c33 to
820591d
Compare
phbnf
approved these changes
Apr 14, 2025
internal/scti/signatures.go
Outdated
| type rfc6962NoteSignature struct { | ||
| timestamp uint64 | ||
| signature rfc6962.DigitallySigned | ||
| type RFC6962NoteSignature struct { |
Collaborator
There was a problem hiding this comment.
I think the struct itself doesn't need to be exported.
Contributor
Author
There was a problem hiding this comment.
Unexported the struct.
Here is the test failure log if the field is unexported.
--- FAIL: TestBuildCp (0.00s)
panic: reflect: reflect.Value.SetUint using value obtained using unexported field [recovered]
panic: reflect: reflect.Value.SetUint using value obtained using unexported field
goroutine 384 [running]:
testing.tRunner.func1.2({0x96f660, 0xc000041b50})
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/testing/testing.go:1734 +0x21c
testing.tRunner.func1()
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/testing/testing.go:1737 +0x35e
panic({0x96f660?, 0xc000041b50?})
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/runtime/panic.go:787 +0x132
reflect.flag.mustBeAssignableSlow(0xaf1b24eac618794b?)
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/reflect/value.go:254 +0xb4
reflect.flag.mustBeAssignable(...)
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/reflect/value.go:244
reflect.Value.SetUint({0x96f860?, 0xc0003f9350?, 0x9eab60?}, 0x15e5c442378)
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/reflect/value.go:2181 +0x45
github.com/transparency-dev/static-ct/internal/types/tls.parseField({0x96f860?, 0xc0003f9350?, 0x930495?}, {0xc0004dc700, 0x74, 0x80}, 0x0, 0xc00052c640)
/usr/local/google/home/rogerng/Git/static-ct/internal/types/tls/tls.go:357 +0x838
github.com/transparency-dev/static-ct/internal/types/tls.parseField({0x9d8700?, 0xc0003f9350?, 0x0?}, {0xc0004dc700, 0x74, 0x80}, 0x0, 0x0)
/usr/local/google/home/rogerng/Git/static-ct/internal/types/tls/tls.go:435 +0x184b
github.com/transparency-dev/static-ct/internal/types/tls.UnmarshalWithParams({0xc0004dc700, 0x74, 0x80}, {0x959280, 0xc0003f9350}, {0x0?, 0x1?})
/usr/local/google/home/rogerng/Git/static-ct/internal/types/tls/tls.go:162 +0xe5
github.com/transparency-dev/static-ct/internal/types/tls.Unmarshal(...)
/usr/local/google/home/rogerng/Git/static-ct/internal/types/tls/tls.go:148
github.com/transparency-dev/static-ct/internal/scti.TestBuildCp(0xc0005896c0)
/usr/local/google/home/rogerng/Git/static-ct/internal/scti/signatures_test.go:430 +0x1b0
testing.tRunner(0xc0005896c0, 0xa7c3f0)
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/testing/testing.go:1792 +0xf4
created by testing.(*T).Run in goroutine 1
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/testing/testing.go:1851 +0x413
Collaborator
|
Just for the record: I ended up copying over some of c-t-go TLS package in https://github.com/transparency-dev/static-ct/pull/202/files. When we have time, think we can use something a bit neater and simpler, but it works for now, and has been for years. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Towards #103.